<template>
  <div class="about">
    <h1>This is an about page</h1>
	<el-button @click="updateX">Primary</el-button><br />
	{{$store.state.num}}<br />
	<el-button @click="getData">获取数据</el-button><br />
	<el-table :data="news" stripe style="width: 100%">
	    <el-table-column prop="title" label="标题" width="180" />
	    <el-table-column prop="digest" label="内容" width="360" />
	    <el-table-column prop="mtime" label="时间" />
	  </el-table>
  </div>
</template>

<script>
	export default{
		data(){
			return{
				news:[]
			}
		},
		methods:{
			updateX(){
				this.$store.commit('num',100)
			},
			getData(){
				let that=this
				this.$axios.get("http://api.tianapi.com/bulletin/index",{
					params:{
						key:'5eb1bd92fda9806a955824d7fccab99c'
					}
				}).then(function(res){
					console.log(res.data.newslist)
					that.news=res.data.newslist
				})
			}
		}
	}
</script>

<style>
	/* .el-button--primary{
		background-color: red;
	}
	.el-button{
		width: 18.75rem;
	} */
	
</style>
